package net.scrumtool.view;

import net.scrumtool.technics.Utils;

import org.eclipse.jface.viewers.ComboViewer;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.TableViewerColumn;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.SashForm;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.TabFolder;
import org.eclipse.swt.widgets.TabItem;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.wb.swt.SWTResourceManager;

public class EditCollaboratorsProduct {

	protected Shell shell;
	private Button btnEditCollaborator;
	private TabFolder tabFolder;
	private TabItem tbtmRemoveCollaborators;
	private TabItem tbtmAddCollaborators;
	private SashForm sashForm;
	private Composite composite_1;
	private Composite composite_2;
	private Table tableAddCollaborators;
	private TableViewer tableViewerAddCollaborators;
	private TableColumn tblclmnName;
	private TableViewerColumn tableViewerColumn;
	private Table tableRoleCollaborators;
	private TableViewer tableViewerRoleCollaborators;
	private TableColumn tblclmnRole;
	private TableViewerColumn tableViewerColumn_1;
	private Button btnEditRole;
	private SashForm sashForm_1;
	private Composite composite_3;
	private Composite composite_4;
	private Table tableRemoveCollaborators;
	private TableViewer tableViewerRemoveCollaborator;
	private TableColumn tblclmnNameRemoveCollaborators;
	private TableViewerColumn tableViewerColumnNameRemoveCollaborator;
	private TableColumn tblclmnRoleRemoveCollaborator;
	private TableViewerColumn tableViewerColumnRoleRemoveCollaborator;
	private Label lblNameCollaboratorEditRole;
	private ComboViewer comboViewer;
	private Button btnSaveEditRole;
	private Combo comboEditRole;

	/**
	 * @wbp.parser.entryPoint
	 */
	public void init() {
		createContents();
	}

	/**
	 * Open the window.
	 */
	public void open() {
		Display display = Display.getDefault();
		shell.open();
		shell.layout();
		while (!shell.isDisposed()) {
			if (!display.readAndDispatch()) {
				display.sleep();
			}
		}
	}

	/**
	 * Create contents of the window.
	 * 
	 * 
	 */
	protected void createContents() {
		shell = new Shell(SWT.CLOSE);
		shell.setSize(431, 636);
		shell.setText("SCRUMTOOL");
		shell.setLayout(new FormLayout());

		Composite composite = new Composite(shell, SWT.NONE);
		composite.setBackground(Utils.COLOR_BAR_1);
		FormData fd_composite = new FormData();
		fd_composite.top = new FormAttachment(0);
		fd_composite.left = new FormAttachment(0);
		fd_composite.bottom = new FormAttachment(0, 107);
		fd_composite.right = new FormAttachment(100);
		composite.setLayoutData(fd_composite);
		shell.setText("SCRUMTOOL - Developed by TEAMSIO - version beta");
		shell.setImage(Utils.getImage(Utils.IMG_ICON));

		Composite compositeNom = new Composite(composite, SWT.NONE);
		compositeNom.setBounds(10, 10, 380, 88);
		compositeNom.setBackgroundImage(Utils.getImage(Utils.IMG_LOGO));

		tabFolder = new TabFolder(shell, SWT.NONE);
		FormData fd_tabFolder = new FormData();
		fd_tabFolder.left = new FormAttachment(composite, 0, SWT.LEFT);
		fd_tabFolder.right = new FormAttachment(composite, 0, SWT.RIGHT);
		fd_tabFolder.top = new FormAttachment(composite, 6);
		tabFolder.setLayoutData(fd_tabFolder);

		tbtmRemoveCollaborators = new TabItem(tabFolder, SWT.NONE);
		tbtmRemoveCollaborators.setText("Collaborator(s) in product");

		sashForm_1 = new SashForm(tabFolder, SWT.VERTICAL);
		tbtmRemoveCollaborators.setControl(sashForm_1);

		composite_3 = new Composite(sashForm_1, SWT.NONE);

		tableViewerRemoveCollaborator = new TableViewer(composite_3, SWT.BORDER | SWT.FULL_SELECTION);
		tableRemoveCollaborators = tableViewerRemoveCollaborator.getTable();
		tableRemoveCollaborators.setLinesVisible(true);
		tableRemoveCollaborators.setHeaderVisible(true);
		tableRemoveCollaborators.setFont(SWTResourceManager.getFont("Arial", 11, SWT.NORMAL));
		tableRemoveCollaborators.setBounds(0, 0, 417, 418);

		tableViewerColumnNameRemoveCollaborator = new TableViewerColumn(tableViewerRemoveCollaborator, SWT.NONE);
		tblclmnNameRemoveCollaborators = tableViewerColumnNameRemoveCollaborator.getColumn();
		tblclmnNameRemoveCollaborators.setWidth(216);
		tblclmnNameRemoveCollaborators.setText("Name");

		tableViewerColumnRoleRemoveCollaborator = new TableViewerColumn(tableViewerRemoveCollaborator, SWT.NONE);
		tblclmnRoleRemoveCollaborator = tableViewerColumnRoleRemoveCollaborator.getColumn();
		tblclmnRoleRemoveCollaborator.setWidth(195);
		tblclmnRoleRemoveCollaborator.setText("Role");

		composite_4 = new Composite(sashForm_1, SWT.NONE);

		Group grpEditRole = new Group(composite_4, SWT.NONE);
		grpEditRole.setText("Edit Role");
		grpEditRole.setBounds(0, 0, 417, 138);

		Label lblCollaboratorEditRole = new Label(grpEditRole, SWT.NONE);
		lblCollaboratorEditRole.setBounds(10, 32, 75, 15);
		lblCollaboratorEditRole.setText("Collaborator :");

		Label lblRoleEditRole = new Label(grpEditRole, SWT.NONE);
		lblRoleEditRole.setBounds(10, 69, 55, 15);
		lblRoleEditRole.setText("Role :");

		lblNameCollaboratorEditRole = new Label(grpEditRole, SWT.NONE);
		lblNameCollaboratorEditRole.setBounds(102, 32, 113, 15);

		comboViewer = new ComboViewer(grpEditRole, SWT.NONE);
		comboEditRole = comboViewer.getCombo();
		comboEditRole.setBounds(102, 66, 113, 23);

		btnSaveEditRole = new Button(grpEditRole, SWT.NONE);
		btnSaveEditRole.setImage(Utils.getImage(Utils.IMG_SAVE));
		btnSaveEditRole.setBounds(332, 103, 75, 25);
		btnSaveEditRole.setText("Save");
		sashForm_1.setWeights(new int[] { 277, 138 });

		tbtmAddCollaborators = new TabItem(tabFolder, SWT.NONE);
		tbtmAddCollaborators.setText("Other collaborator(s)");

		sashForm = new SashForm(tabFolder, SWT.NONE);
		tbtmAddCollaborators.setControl(sashForm);

		composite_1 = new Composite(sashForm, SWT.NONE);

		tableViewerAddCollaborators = new TableViewer(composite_1, SWT.BORDER | SWT.FULL_SELECTION);
		tableAddCollaborators = tableViewerAddCollaborators.getTable();
		tableAddCollaborators.setLinesVisible(true);
		tableAddCollaborators.setHeaderVisible(true);
		tableAddCollaborators.setFont(SWTResourceManager.getFont("Arial", 11, SWT.NORMAL));
		tableAddCollaborators.setBounds(0, 0, 197, 418);

		tableViewerColumn = new TableViewerColumn(tableViewerAddCollaborators, SWT.NONE);
		tblclmnName = tableViewerColumn.getColumn();
		tblclmnName.setWidth(193);
		tblclmnName.setText("Name");

		composite_2 = new Composite(sashForm, SWT.NONE);

		tableViewerRoleCollaborators = new TableViewer(composite_2, SWT.BORDER | SWT.FULL_SELECTION);
		tableRoleCollaborators = tableViewerRoleCollaborators.getTable();
		tableRoleCollaborators.setLinesVisible(true);
		tableRoleCollaborators.setHeaderVisible(true);
		tableRoleCollaborators.setFont(SWTResourceManager.getFont("Arial", 11, SWT.NORMAL));
		tableRoleCollaborators.setBounds(0, 0, 197, 418);

		tableViewerColumn_1 = new TableViewerColumn(tableViewerRoleCollaborators, SWT.NONE);
		tblclmnRole = tableViewerColumn_1.getColumn();
		tblclmnRole.setWidth(192);
		tblclmnRole.setText("Role");
		sashForm.setWeights(new int[] { 1, 1 });

		Composite compositeButtonsRemoveCollaborators = new Composite(shell, SWT.NONE);
		fd_tabFolder.bottom = new FormAttachment(compositeButtonsRemoveCollaborators, -6);
		compositeButtonsRemoveCollaborators.setBackground(Utils.COLOR_BAR_1);
		FormData fd_compositeButtonsRemoveCollaborators = new FormData();
		fd_compositeButtonsRemoveCollaborators.top = new FormAttachment(100, -42);
		fd_compositeButtonsRemoveCollaborators.left = new FormAttachment(composite, 0, SWT.LEFT);
		fd_compositeButtonsRemoveCollaborators.bottom = new FormAttachment(100);
		fd_compositeButtonsRemoveCollaborators.right = new FormAttachment(composite, 0, SWT.RIGHT);
		compositeButtonsRemoveCollaborators.setLayoutData(fd_compositeButtonsRemoveCollaborators);

		btnEditCollaborator = new Button(compositeButtonsRemoveCollaborators, SWT.NONE);
		btnEditCollaborator.setBounds(325, 10, 90, 25);

		btnEditRole = new Button(compositeButtonsRemoveCollaborators, SWT.NONE);
		btnEditRole.setImage(Utils.getImage(Utils.IMG_EDIT));
		btnEditRole.setBounds(229, 10, 90, 25);
		btnEditRole.setText("Edit role");
	}

	public Combo getComboEditRole() {
		return comboEditRole;
	}

	public Button getBtnSaveEditRole() {
		return btnSaveEditRole;
	}

	public ComboViewer getComboViewer() {
		return comboViewer;
	}

	public Label getLblNameCollaboratorEditRole() {
		return lblNameCollaboratorEditRole;
	}

	public SashForm getSashForm_1() {
		return sashForm_1;
	}

	public Button getBtnEditRole() {
		return btnEditRole;
	}

	public Table getTableRoleCollaborators() {
		return tableRoleCollaborators;
	}

	public TableViewer getTableViewerRoleCollaborators() {
		return tableViewerRoleCollaborators;
	}

	public TableViewer getTableViewerAddCollaborators() {
		return tableViewerAddCollaborators;
	}

	public TabItem getTbtmRemoveCollaborators() {
		return tbtmRemoveCollaborators;
	}

	public TabItem getTbtmAddCollaborators() {
		return tbtmAddCollaborators;
	}

	public TabFolder getTabFolder() {
		return tabFolder;
	}

	public Table getTableAddCollaborators() {
		return tableAddCollaborators;
	}

	public Shell getShell() {
		return shell;
	}

	public Button getBtnEditCollaborator() {
		return btnEditCollaborator;
	}

	public Table getTableRemoveCollaborators() {
		return tableRemoveCollaborators;
	}

	public TableViewerColumn getTableViewerColumnRoleRemoveCollaborator() {
		return tableViewerColumnRoleRemoveCollaborator;
	}

	public TableViewerColumn getTableViewerColumnNameRemoveCollaborator() {
		return tableViewerColumnNameRemoveCollaborator;
	}

	public TableViewer getTableViewerRemoveCollaborator() {
		return tableViewerRemoveCollaborator;
	}
}
